package com.oa.util;

import java.io.UnsupportedEncodingException;
import javax.servlet.*;
import javax.servlet.http.*;

public abstract class RequestUtil {

  public static  String getParameter(ServletRequest request, String name) {
    String retValue = null;
    HttpServletRequest req = null;
    if (request instanceof HttpServletRequest) {
      req = (HttpServletRequest)request;
    } else {
      return retValue;
    }
    if (name == null) {
      return retValue;
    }
    String value = req.getParameter(name);
    if (value == null ) {
      return retValue;
    } else {
      try {
        retValue = new String(value.getBytes("iso-8859-1"), "gbk");
      } catch (UnsupportedEncodingException uex) {
      }
    }
    return retValue;
  }

}